package com.dawn.java.common.String;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Ruffianjiang
 * @version V1.0
 * @Title: StringTest
 * @Package java4learn
 * @date 2019/4/27 23:21
 */
@Slf4j
public class StringTest {

    public static void main(String[] args) {
        String a = "hello";
        String b = "hello";
        String c = new String("hello");
        String d = new String("hello");
        String e = "he" + "llo";
        final String temp = "he";
        String f = temp + "llo";
        log.info("a == b : {}",a == b);
        log.info("a.equals(b) : {}",a.equals(b));
        log.info("a == c : {}",a == c);
        log.info("c == d : {}",c == d);
        log.info("c.equals(d) : {}",c.equals(d));
        log.info("a == e : {}", a == e);
        log.info("a == f : {}", a == f);
        log.info("e == f : {}", e == f);
    }

}
